


        var originalScrollTop,consultScrollTop;
        var atTop = false;
        var mobileMenuMoving = null;
        var mobileMenuInview = false;
        var originalWindowWidth,consultWindowWidth;
        //延迟跳转
        var linkJumpCount = 1.5;
        var linkHref;
        function countDown(){
            linkJumpCount -= 0.5;
           
            //linkJumpCount=0时，跳转页面
            if(linkJumpCount <= 0){
                location.href = linkHref;
            }

            //每秒执行一次,phoneTime()
            setTimeout("countDown()",1000);
        }
        //禁止手指滑动页面
        function bodyScroll(event) {
            　event.preventDefault();
        }
        //内容高度是否小于屏幕高度
        function checkContnHeight(){
            if($('.container')[0].offsetHeight < window.innerHeight){
                $('.container').addClass('fillAll');
            }
        }
        
        //判断是否为移动设备
        function browserRedirect(){
            var sUserAgent = navigator.userAgent.toLowerCase();
            var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
            var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
            var bIsMidp = sUserAgent.match(/midp/i) == "midp";
            var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
            var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
            var bIsAndroid = sUserAgent.match(/android/i) == "android";
            var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
            var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
            if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
                $('body').addClass('mobileDevice');
            }
        }
        
        //延迟动画
        var beginningDelay = null;
        var animateDelayCount = 150;

        var recover = null;
        function makeTimeOut(ind){

            var time;
            if($('header nav')[0].className.indexOf('active') >= 0){
                time = 80 * ($('header nav .block .box').length - 1 - ind);
                setTimeout(function(){
                    $('header nav .block .box')[ind].className = $('header nav .block .box')[ind].className.replace('hidden','');
                },time)
            }else{
                time = 80 * ind;
                setTimeout(function(){
                    $('header nav .block .box')[ind].className = $('header nav .block .box')[ind].className + ' opacity';
                    
                },time);
            }
            
            
        }
        $(document).ready(function(){
            consultScrollTop = originalScrollTop = document.documentElement.scrollTop || document.body.scrollTop;
            consultWindowWidth = originalWindowWidth = window.innerWidth;
            
            //链接延迟跳转
            /*$('a').click(function(e){
                //return false;
                linkHref = $(this).attr('href');
                 var ae = e || window.event;
                 if(ae.preventDefault){ // w3c
                     $('body>.container').addClass('transparent');
                     $('.loading').css('opacity','1');
                     countDown();
                     ae.preventDefault();
                 } else { // ie
                     $('body>.container').addClass('transparent');
                     $('.loading').css('opacity','1');
                     countDown();
                     ae.returnValue = false;
                 }
            })*/
            console.log(window.performance.navigation.type);
            //判断设备类型
            browserRedirect();
            //setTimeout(checkContnHeight,10);
           $('header .menuBtn .btn').click(function(){
               if(recover != null) return false;
               $('header nav').addClass('active');
               for(var s = 0;s < $('header nav .block .box').length;s++){
                   var ind = s;
                   makeTimeOut(ind);
               }
           })

           $('header nav .close').click(function(){
                $('header nav').removeClass('active');
                for(var s = 0;s < $('header nav .block .box').length;s++){
                    var ind = s;
                    makeTimeOut(ind);
                }
                var recoverTime = 80 * (s - 1) + 1000;
                recover = setTimeout(function(){
                    $('header nav .block .box').removeClass('opacity');
                    $('header nav .block .box').addClass('hidden');
                    recover = null;
                },recoverTime)
           })
        })